package languagex

import (
	"github.com/Lofanmi/pinyin-golang/pinyin"
	"regexp"
	"strings"
)

var dict = pinyin.NewDict()
var compile, _ = regexp.Compile(`\b\w`)

func GetFirstLetter(wanted, sep string) string {
	return dict.Abbr(wanted, sep)
}
func GetSentenceLetter(wanted, sep string) string {
	//all := compile.FindAllString(dict.Name(wanted, sep).None(), -1)
	all := compile.FindAllString(dict.Sentence(wanted).None(), -1)
	return strings.ToLower(strings.Join(all, sep))
}
